<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <form action="xxx" onsubmit="return login()">
        <p>账号:<input id="账号" type="text" placeholder="请输入账号" maxlength="10"></p>
        <p>密码:<input id="密码" type="password"></p>
        <p>性别:
            <input type="radio" name="sex" checked="checked">男
            <input type="radio" name="sex">女
        </p>
        <p>学历:
            <input type="radio" name="study" checked="checked">本科
            <input type="radio" name="study">专科
        </p>
        <p>自我介绍:
            <textarea id="intro" cols="50" rows="8" placeholder="请写出您的自我介绍"></textarea>
        </p>
        <button>提交</button>
    
        
        <script>
             function show_introduction() {
                var introduct = document.getElementById("intro").value;
                alert("自我介绍: " + introduct);
            }
 
            function login(){
                var username=document.getElementById("账号").value;
                if(username!="admin"){
                    alert("账号输入错误!");
                    return false; //阻止表单提交
                }else{
                    alert("账号正确!")
                    show_introduction();
                    return true; //让表单提交
        
                }
            }
        </script>
    </form>
</body>
</html>